using RadioTimer.ViewModels;

namespace RadioTimer.Views;

public partial class LogPage : ContentPage
{
    public LogPage(LogPageViewModel viewModel)
    {
        InitializeComponent();
        BindingContext = viewModel;
    }

    private async void OnClearLogsClicked(object sender, EventArgs e)
    {
        if (BindingContext is LogPageViewModel viewModel)
        {
            viewModel.ClearLogsCommand.Execute(null);
        }
    }

    private async void OnRefreshClicked(object sender, EventArgs e)
    {
        if (BindingContext is LogPageViewModel viewModel)
        {
            viewModel.RefreshCommand.Execute(null);
        }
    }
}